//
//  UIView+BCError.h
//  GSBlockChain
//
//  Created by guoshikeji_a on 2018/12/3.
//  Copyright © 2018 guoshikeji. All rights reserved.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

@interface UIView (BCError)

- (void)bc_showError:(nonnull NSError *)error;
- (void)bc_showError:(nonnull NSError *)error
         needRefresh:(BOOL)needRefresh
        refreshTitle:(nullable NSString *)refreshTitle
              target:(nullable id)target
       refreshAction:(nullable SEL)action;
/**
 * @brief 显示错误覆盖在view上 默认背景颜色白色
 * @prama insets 内边距
 * @prama error 错误
 * @prama needRefresh 是否需要刷新按钮
 * @prama refreshTitle 刷新按钮title 如果needRefresh 默认=点击刷新
 * @prama target 点击按钮关联的target
 * @prama action 点击按钮关联方法
 */
- (void)bc_showWithInsets:(UIEdgeInsets)insets
                    error:(nonnull NSError *)error
              needRefresh:(BOOL)needRefresh
             refreshTitle:(nullable NSString *)refreshTitle
                   target:(nullable id)target
            refreshAction:(nullable SEL)action;

- (void)bc_hiddenError;

@end

NS_ASSUME_NONNULL_END
